//
//  GQInfoController.m
//  GuQu
//
//  Created by HELIUM STAR on 15/5/9.
//  Copyright (c) 2015年 HELIUM STAR. All rights reserved.
//

#import "GQInfoController.h"
#import "GQInfomationCell.h"
#import "GQInfomationDetailController.h"
#import "GQInfomationHeaderView.h"
#define flag @"flag"

@interface GQInfoController () <UITableViewDataSource, UITableViewDelegate>
@property (weak, nonatomic) UITableView *tableView;
@end

@implementation GQInfoController

- (void)viewDidLoad
{
    [super viewDidLoad];
    UITableView *tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, self.view.height - kNavigatationBarHeight - kToolBarHeight)];
    tableView.showsVerticalScrollIndicator = NO;
    tableView.tableHeaderView = [[GQInfomationHeaderView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 200)];
    tableView.delegate = self;
    tableView.dataSource = self;
    [self.view addSubview:tableView];
    self.tableView = tableView;
    [tableView registerClass:[GQInfomationCell class] forCellReuseIdentifier:flag];
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 10;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    GQInfomationCell *cell = [tableView dequeueReusableCellWithIdentifier:flag];
    
    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 68;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    GQInfomationDetailController *GQIDC = [[GQInfomationDetailController alloc] init];
    [self.navigationController pushViewController:GQIDC animated:NO];
}

//- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
//{
//    NSLog(@"123");
//    GQInfomationHeaderView *headerView = [[GQInfomationHeaderView alloc] initWithFrame:CGRectMake(0, 0, self.view.width, 300)];
//    return headerView;
//}

@end
